import React, { Component } from 'react';
import {
  StyleSheet,
  View,
  Text,
  Platform,
  Image,
  Dimensions,
  ConsoleModule,
  Modal,
  TextInput,
} from '@hippy/react';

import { ToastModule } from '../../module/ToastMsg';

const styles = StyleSheet.create({
  container: {
    backgroundColor: "white",
  },
  textBg: {
    backgroundColor: '#f5f7fb',
    borderRadius: 6,
    marginTop: 10,
    marginLeft: 15,
    marginRight: 15,
    marginBottom: 10,
    height: 50,
    flexDirection: 'row',
    alignItems: 'center',
    overflow: 'hidden'
  },
  tip1: {
    marginLeft: 2,
    color: "#4377dd",
    fontSize: 28,
    fontWeight: 'bold', 
    fontStyle: 'italic',
    fontFamily: 'TTTGB',
    minWidth: 60,
  },
  tip2: {
    color: "#000",
    fontSize: 28,
    fontWeight: 'bold', 
    fontStyle: 'italic',
    fontFamily: 'TTTGB',
    minWidth: 60,
  },
  msg: {
    marginLeft: 6,
    marginRight: 15,

  },
  moreBg: {
    position: 'absolute',
    right: 0,
    top: 0,
    height: 50,
    backgroundColor: '#f5f7fb',
    justifyContent: 'center',
    alignItems: 'center'
  },
  moreText: {
    marginLeft: 12,
    marginRight: 15,
    color: 'gray',
  },
});

export default class HomeNotice extends Component {
  constructor(props) {
    super(props);

  }

  _moreDidTapped = () => {
    ConsoleModule.log('~~~~~~~~~~~~~~~~~ 点击了更多按钮 ~~~~~~~~~~~~~~~~~');
    ToastModule.toast("点击了更多按钮")
  };

  render() {
    return (
      <View style={styles.container}>
        <View style={styles.textBg}>
          <Text style={styles.tip1}>银行</Text> 
          <Text style={styles.tip2}>公告</Text> 
          <Text style={styles.msg} numberOfLines={1}>关于系统升级期间暂停受理线上渠道的通知消息癌筛哦收到阿斯加德哈佳士得卡死</Text> 
          <View style={styles.moreBg} onClick={this._moreDidTapped}>
            <Text style={styles.moreText}>更多</Text>
          </View> 
        </View>
      </View>
    );
  }
}
